Deriving Model-to-Code Transformation Rules at the Meta- Model Level
نویسندگان
چکیده
The Unified Modeling Language (UML) has been widely accepted in the software development industry because of the benefits it brings to the task of specifying system requirements and design decision. However, models are not the final product of a software development cycle. Application code, which is compiled and executed, has to be derived from these models. Work on deriving transformation techniques at the metamodel level of abstraction is a necessary and valuable research area for the successful automatic generation of programming language code from graphical design models of software systems. By working at the meta-model level of abstraction it is possible to state with a high degree of certainty that all constructs at the model level of abstraction will be taken into consideration. Introduction: By using graphical and module design, the UML (Unified Modeling Language) models present systems’ requirement in a graphical manner. Compared with other system design tools, UML models make it much easier for software engineers to understand software system requirements. Although the UML models are widely used in system design, they are not the final products for software engineering. Application code, which is complied and executed, should be generated from the UML models. Tools for supporting the generation of application code from UML models are not developed to the point where they can generate complete code from the design models. One possible cause of this problem is the difficulty of precisely stating the relationships between the model elements and the code, in the form of a program that has to be produced. In our work, transformation rules to go from UML activity diagram to C programming code will be explored at the meta-model level of both activity diagram and C language program. The reason we choose the UML activity diagram for our research is because of its capability to express action flows and object interaction for an application system. C’s relative simple program structure and small set of statements constructs, is the reason chosen as the target language for this research. A number of previous works on model transformation to executable program code have focused on the transformation at the model level. The techniques of these previous works have limited applications as they only address the transformation of specific instances of a model, and not all possible models of a particular type, into the chosen programming language code. The model level transformation rules limit reusability of the code generation technique, as the technique may not take into consideration all possible aspects of the model being transformed. For that reason, we focus on setting up the transformation rules at the meta-model level of both activity diagram and C programming language. By working at the meta-model level of abstraction it is possible to state with a high degree of certainty that all constructs at the model level of abstraction will be taken into consideration. After organizing the common C programming statement into a meta model description (class diagram in UML), transformation rules from the meta model of activity diagram to the meta model of C programming language will be explored, e.g. we will give the rules from activity diagram to corresponding C program code. As a demonstration of the benefits of our work, we will present examples of the application of the transformation rules on a set of activity diagram models, which have been taken from different application domains. Code for these demonstration samples will be generated manually based on the rules generated on the meta models of activity diagram and C programming language. We will compile and execute generated code and see whether execution result may satisfy system requirement from the beginning. Background: The Unified Modeling Language (UML) is used to specify and document software entities at the analysis and design levels in software development. The UML defines several graphical models: class diagram, collaboration diagram, activity diagram, use case, sequence diagram and implementation diagrams. Class diagram captures static relation between different classes in a software system and expresses it in a graphical view. An activity diagram shows the activity sequence of instances from different classes. All states in an activity diagram are actions and triggered by completion of the actions in the source state (i.e activity sequence). Usually, an activity diagram is attached with a classifier, such as a use case diagram and class diagram. It focuses on flows driven by internal processing. There are four different layers for UML models: meta-meta model, meta model, model, user objects. A meta-meta model defines the language for specifying meta models. Metamodel is an instance of a meta-meta model and it defines the language for specifying models. A model is an instance of a meta model and it focuses on describing an information domain such as specified operations and attributes. User object (also called user data) is an instance of a model, which gives the values in the domains. Among these four layers, the meta-model describes all models for that category. That is the reason why we will work at the meta-model level of both activity diagram and C programming language. Activity diagram An activity diagram is a special case of a state diagram, which is a sequence of operations. A state in the sequence is triggered by the completion of the operation from a previous state. An example of an activity diagram is shown in Figure 1. Person:: Cook dinner Figure 1: Example of activity diagram There are several different states in this activity diagram. Action state: An action state is a state with an entry action and one or more outgoing transition to implicit event after completing the entry action. One example of action state is shown in Figure 2, where an action state is shown as a shape with straight top and bottom and with convex arcs on the two sides. Expression of the action state is placed in the middle of the graph and it need not to be unique within the diagram. Figure 2: Action state Sub activity state A sub activity state is a group of nested action states, which cannot be exited until the last state has been reached. Sub activity state has the same symbol like that of an action state Cook meat Cook vegetable
منابع مشابه
Automatic generation of platform-specific transformation
The current paper presents a new approach using generic and meta-transformations for generating platform-specific transformer plugins from model transformation specifications defined by a combination of graph transformation and abstract state machine rules (as used within the VIATRA2 framework). The essence of the approach is to store transformation rules as ordinary models in the model space, ...
متن کاملDefining and validating transformations of UML models
With the success of the UML, the ability of transforming models into programs or formal specifications becomes a key to automated code generation or verification in the software development process. In this paper, we describe a concept for specifying model transformations by means of graph transformation rules on the UML meta model. In order to validate the termination and uniqueness of such tr...
متن کاملA Hybrid Meta-heuristic Approach to Cope with State Space Explosion in Model Checking Technique for Deadlock Freeness
Model checking is an automatic technique for software verification through which all reachable states are generated from an initial state to finding errors and desirable patterns. In the model checking approach, the behavior and structure of system should be modeled. Graph transformation system is a graphical formal modeling language to specify and model the system. However, modeling of large s...
متن کاملSolving the FIXML Case Study Using Epsilon and Java
ion Level. Our solution combines imperative code in Java and declarative scripts in ETL and EGL. As a result, according to the evaluation criteria [2], the abstraction level of (a) the Java code to launch transformations is low, (b) XML to XML-model transformation is low, (c) XML-model to Object-model transformation is high, (d) Object-model to code transformation is high, and (e) the overall s...
متن کاملFrom transformation traces to transformation rules: Assisting model driven engineering approach with formal concept analysis
In this paper we are interested in semi-automatically generating labelled graph (model) transformations conform to a particular syntax (meta-model). Those transformations are basic operations in model driven engineering. They are usually developed by specialised programmers and for every change the source code must be updated. Our proposition is about generating transformation rules between two...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2004